export const GenderEnum = [
  { id: 1, label: '男' },
  { id: 0, label: '女' },
] as const

export const identityEnum = [
  { id: 0, label: '无' },
  { id: 1, label: '研发' },
  { id: 2, label: '交付' },
] as const

export const needWorkEnum = [
  { id: 0, label: '不需要' },
  { id: 1, label: '需要' },
] as const

export function getLabelForKey(searchList: Array<any>, key: any, val: any, filed: string): string {
  const res = searchList.find((item) => item[key] === val)
  return res ? res[filed] : '未知'
}

export function getGenderLabel(id: number): string {
  const res = GenderEnum.find((item) => item.id === id)
  return res ? res.label : '未知性别'
}

export function getIdentityLabel(id: number): string {
  const res = identityEnum.find((item) => item.id === id)
  return res ? res.label : '未知'
}
